<%@page import="com.group1.bookmanagement.domain.Label"%>
<%@page import="java.util.List"%>
<%@page import="org.springframework.context.support.ClassPathXmlApplicationContext"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@page import="com.group1.bookmanagement.service.LabelService"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp"%>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>书籍添加</title>
        <link rel="stylesheet" media="all" href="${ctx}/jsp/css/web-2b26d78a4d3c053b7b1c.css" />
        <link rel="stylesheet" media="all" href="${ctx}/jsp/css/entry-d61d60cb91db6dd7e79a.css" />
        <script type="text/javascript" src="${ctx}/jsp/js/date.js"></script>   
    </head>
    <body>
        <!-- 全局顶部导航栏 -->
        <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
            <div class="width-limit">
                <!-- 左上方 Logo -->
                <a class="logo" href="/" style="color:rgb(236 97 73);font-size:23px;margin-left:45px;margin-top:10px;">鱼巷猫未归</a>

                <!-- 右上角 -->
                <!-- 未登录显示登录/注册/写文章 -->
                <a class="btn write-btn" href="#">
                    <i class="iconfont ic-write"></i>上架书籍
                </a>
                <a class="btn sign-up" href="${ctx}/bookAction_toIndex">返回</a>
                <a class="btn log-in" href="${ctx}/userAction_logout">退出</a>
                <a class="btn log-in" href="${ctx}/jsp/user_edit.jsp">${user.nickName}</a>

                <!-- 如果用户登录，显示下拉菜单 -->

                <div id="view-mode-ctrl">
                </div>
                <div class="container">
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#menu" aria-expanded="false">
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>  
                        </button>
                    </div>
                    <div class="collapse navbar-collapse" id="menu">
                        <ul class="nav navbar-nav">
                            <li class="tab ">
                                <a href="${ctx}/bookAction_toIndex">
                                    <span class="menu-text">首页</span><i class="iconfont ic-navigation-discover menu-icon"></i>
                                </a>
                            </li>
                            
                            <li class="search">
                                <form target="_blank" action="/search" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="&#x2713;" />
                                    <input type="text" name="q" id="q" value="" autocomplete="off" placeholder="搜索" class="search-input" />
                                    <a class="search-btn" href="javascript:void(null)"><i class="iconfont ic-search"></i></a>
                                </form>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </nav>
        
            <label class="tjsjxx">添加书籍信息</label>
            <form method="post" class="fff" name="reg_testdate" enctype="multipart/form-data" action="${ctx}/bookAction_add">
                <div class="ziliao">
                    
                        <div class="ziliao1">
                            <div class="ziliao2">
                                <label>书名</label>
                            </div>
                            <div class="ziliao3">
                                <input type="text" name="bookName" class="t1" placeholder="请填写书名"/>
                            </div>
                        </div>
                        
                        <div class="ziliao1">
                            <div class="ziliao2">
                                <label>分类</label>
                            </div>
                            <div class="ziliao3">
                                <select name="labelId">
                                    <%
                                        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
                                        LabelService labelService = (LabelService) context.getBean("labelService");
                                        List<Label> list = labelService.listLabel();
                                        for (Label label : list) {
                                    %>
                                        <option value="<%=label.getId() %>"><%=label.getLabelName() %></option>
                                    <%
                                        }
                                    %>
                                </select>
                            </div>
                        </div>
                        
                        <div class="ziliao1">
                            <div class="ziliao2">
                                <label>作者</label>
                            </div>
                            <div class="ziliao3">
                                <input type="text" name="authorName" class="t1" placeholder="请填写作者"/>
                            </div>
                        </div>
                        
                        <div class="ziliao1">
                            <div class="ziliao2">
                                <label>出版社</label>
                            </div>
                            <div class="ziliao3">
                                <input type="text" name="press" class="t1" placeholder="请填写出版社"/>
                            </div>
                        </div>
                        
                        <div class="ziliao1">
                            <div class="ziliao2">
                                <label>出版日期</label>
                            </div>
                            <div class="ziliao3">
                                <select name="YYYY" onchange="YYYYDD(this.value)" class="dataaa">
                                        <option value="">请选择 年</option>
                                </select>
                                <select name="MM" onchange="MMDD(this.value)" class="dataaa">
                                        <option value="">选择 月</option>
                                </select>
                                <select name="DD" class="dataaa">
                                        <option value="">选择 日</option>
                                </select>
                            </div>
                        </div>
                        
                        <div class="ziliao1">
                            <div class="ziliao2">
                                <label>金额</label>
                            </div>
                            <div class="ziliao3">
                                <input type="text" name="price" class="t1" placeholder="请填写金额"/>
                            </div>
                        </div>
                        
                        <div class="ziliao1">
                            <div class="ziliao2">
                                <label>简介</label>
                            </div>
                            <div class="ziliao3">
                                <input type="text" name="introduction" class="t1" placeholder="请填写简介"/>
                            </div>
                        </div>
                        
                        <div class="ziliao1">
                            <div class="ziliao2">
                                <label>书籍图片</label>
                            </div>
                            <div class="ziliao3">           
                                <a href="javascript:;" class="file">请上传图片
                                    <input type="file" name="file" id="">
                                </a>
                            </div>
                        </div>
                        <div class="tijiaoaaaa">
                            <input type="submit" value="确定" class="tjsjxxxx"/>
                        </div>
                </div>
            </form>
    
                                
            
            
            <style type="text/css">
                .dataaa{
                    font-family: inherit;
                    font-size: inherit;
                    line-height: inherit;
                    border: 1px solid blue;
                    width: 130px;
                    border: 1px solid #ccc;
                    border-radius: 4px;
                    color: #555;
                    text-align: center;
                    height:35px;
                    font-size:14px;
                }
                .tjsjxx{
                    border:1px solid rgb(236 97 73);
                    width:200px;
                    height:50px;
                    margin:0 auto;
                    text-align: center;
                    margin-left:615px;
                    margin-top:30px;
                    line-height: 50px;
                    color:rgb(236 97 73);
                    background-color: #fff;
                    border-radius: 7px;
                }
                .tjsjxxxx{
                    border:1px solid rgb(236 97 73);
                    width:315px;
                    height:48px;
                    margin:0 auto;
                    text-align: center;
                    margin-left: 145px;
                    margin-top: 0px;
                    line-height: 50px;
                    color:rgb(236 97 73);
                    background-color: #fff;
                    border-radius: 7px;
                }
                .file {
                    position: relative;
                    display: inline-block;
                    background: #FFF;
                    border: 1px solid rgb(236 97 73);
                    border-radius: 4px;
                    padding: 4px 12px;
                    overflow: hidden;
                    color: rgb(236 97 73);
                    text-decoration: none;
                    text-indent: 0;
                    line-height: 20px;
                    width:400px;
                    text-align: center;
                }
                .file input {
                    position: absolute;
                    font-size: 100px;
                    right: 0;
                    top: 0;
                    opacity: 0;
                }
                /*.file:hover {
                    background: #AADFFD;
                    border-color: #78C3F3;
                    color: #004974;
                    text-decoration: none;
                }*/
                .fff{
                    border:1px solid none;
                    width:680px;
                    margin-left:441px;
                    margin-top:50px;
                }
                .t1{
                    display: block;
                    width: 400px;
                    height: 34px;
                    padding: 6px 12px;
                    font-size: 14px;
                    line-height: 1.42857143;
                    color: #555;
                    background-color: #fff;
                    background-image: none;
                    border: 1px solid #ccc;
                    border-radius: 4px;
                   
                }
                /*.ziliao{
                    border:1px solid blue;
                    margin-bottom: 10px;
                
                }*/
                .ziliao1{
                    border:1px solid none;
                    width:680px;
                    margin-bottom: 10px;
                }
                .ziliao2{
                    float:left;
                    margin-top: 4px;
                    border:1px solid none;
                    width:70px;
                    text-align: right;
                    margin-right:30px;
                    font-size: 14px;
                    color: #555;
                    font-family: "微软雅黑";
               }
            </style>
    </body>
</html>
